colnames(Cooking)[3]="Nb.brothers.and.sisters" levels(Cooking$Lifestyle) <- c("dynamic", "slightly.quiet", "quiet", "very.dynamic", "very.quiet") colnames(Cooking)[5:12]=c("hobby.Internet", "hobby.Theatre", "hobby.Art", "hobby.Trip", "hobby.Party", "hobby.Music", "hobby.Cinema", "hobby.Sport") colnames(Cooking)[14]="Living" colnames(Cooking)[17]="Eat.at.canteen" levels(Cooking$education) <- c("slightly.traditional.education", "openminded.education", "traditional.education", "very.openminded.education", "very.traditional.education") colnames(Cooking)[19]="frequency.at.home" levels(Cooking$frequency.at.home) <- c("everyday", "once.a.month", "once.a.week", "once.a.year", "twice.a.month") colnames(Cooking)[20:23]=c("consume.mostly.pasta", "consume.mostly.rice", "consume.mostly.potatoes", "frequency.consume.starchyfood") levels(Cooking$frequency.consume.starchyfood) <- c("more.than.once.a.day", "more.than.once.a.week", "once.a.day", "once.a.week") colnames(Cooking)[24:38]=c("consume.mostly.milk", "consume.mostly.cheese", "consume.mostly.cream", "consume.mostly.yoghurt", "frequency.consume.dairy.products", "frequency.consume.eggs", "consume.mostly.pork", "consume.mostly.beef", "consume.mostly.poultry", "consume.mostly.veal", "frequency.consume.meat", "consume.mostly.steam.fish", "consume.mostly.fried.fish", "consume.mostly.pickled.in.brine.fish", "frequency.consume.fish") levels(Cooking$frequency.consume.dairy.products) <- c("more.than.once.a.day", "more.than.once.a.week", "never", "once.a.day", "once.a.week") levels(Cooking$frequency.consume.eggs) <- c("more.than.once.a.week", "never", "once.a.day", "once.a.week") levels(Cooking$frequency.consume.meat) <- c("more.than.once.a.day", "more.than.once.a.week", "never", "once.a.day", "once.a.week") levels(Cooking$frequency.consume.fish) <- c("more.than.once.a.week", "never", "once.a.month", "once.a.week", "twice a month") colnames(Cooking)[39]="Possess.cookbooks" colnames(Cooking)[40]="Cooking.self.educated" levels(Cooking$Cooking.self.educated) <- c("most", "completely", "slightly", "medium", "not.at.all") colnames(Cooking)[41]="Watch.cooking.shows" colnames(Cooking)[42:45]=c("recipes.from.Internet", "recipes.from.books", "recipes.from.newspapers", "recipes.from.cooking.shows") colnames(Cooking)[46:50]=c("parents.teach", "friends.teach", "grandparents.teach", "myself.teach", "cooker.teach") colnames(Cooking)[51]="Possess.kitchenwares" levels(Cooking$Possess.kitchenwares) <- c("a.lot", "little", "average", "minimum", "quite.a.lot") levels(Cooking$Purpose.cooking) <- c("both.pleasure.and.feeding", "feeding", "more.feeding.than.pleasure", "more.pleasure.than.feeding", "pleasure") colnames(Cooking)[54:61]=c("frequency.consume.vegetables", "consume.mostly.raw.vegetables", "consume.mostly.cooked.vegetables", "consume.mostly.green.vegetables", "frequency.consume.fruits", "consume.mostly.season.fruits", "consume.mostly.out.of.season.fruits", "consume.mostly.exotic.fruits") levels(Cooking$frequency.consume.vegetables) <- c("more.than.once.a.day", "more.than.once.week", "once.a.day", "once.a.week") levels(Cooking$frequency.consume.fruits) <- c("more.than.once.a.day", "more.than.once.a.week", "never", "once.a.day", "once.a.week") levels(Cooking$Frequency.restaurants) <- c("less.than.once.a.month", "once.a.month", "once.a.week", "twice.a.month") levels(Cooking$Frequency.fastfood) <- c("less.than.once.a.month", "once.a.month", "once.a.week", "twice.a.month") colnames(Cooking)[66]="Frequency.consume.delivered.food" levels(Cooking$Frequency.consume.delivered.food) <- c("less.than.once.a.month", "once.a.month", "twice.a.month") levels(Cooking$Frequency.supermarket) <- c("less.than.once.a.month", "more.than.once.a.week", "once.a.month", "once.a.week", "twice.a.month") library(FactoMineR) library(dynGraph) library(EnQuireR) summary(Cooking) #MCA Cooking.MCA<-Cooking[, c("consume.mostly.pasta", "consume.mostly.rice", "consume.mostly.potatoes", "frequency.consume.starchyfood", "consume.mostly.milk", "consume.mostly.cheese", "consume.mostly.cream", "consume.mostly.yoghurt", "frequency.consume.dairy.products", "frequency.consume.eggs", "consume.mostly.pork", "consume.mostly.beef", "consume.mostly.poultry", "consume.mostly.veal", "frequency.consume.meat", "consume.mostly.steam.fish", "consume.mostly.fried.fish", "consume.mostly.pickled.in.brine.fish", "frequency.consume.fish", "Possess.cookbooks", "Cooking.self.educated", "Watch.cooking.shows", "recipes.from.Internet", "recipes.from.books", "recipes.from.newspapers", "recipes.from.cooking.shows", "parents.teach", "friends.teach", "grandparents.teach", "myself.teach", "cooker.teach", "Possess.kitchenwares", "Like.cooking", "Purpose.cooking", "frequency.consume.vegetables", "consume.mostly.raw.vegetables", "consume.mostly.cooked.vegetables", "consume.mostly.green.vegetables", "frequency.consume.fruits", "consume.mostly.season.fruits", "consume.mostly.out.of.season.fruits", "consume.mostly.exotic.fruits", "Frequency.restaurants", "Budget.Restaurants", "Frequency.fastfood", "Budget.Fastfood", "Frequency.consume.delivered.food", "Frequency.supermarket", "Budget.Market", "Age", "Nb.brothers.and.sisters", "Sex", "Lifestyle", "hobby.Internet", "hobby.Theatre", "hobby.Art", "hobby.Trip", "hobby.Party", "hobby.Music", "hobby.Cinema", "hobby.Sport", "Raised", "Living", "job.mother", "job.father", "Eat.at.canteen", "education", "frequency.at.home")] res<-MCA(Cooking.MCA, ncp=5, quanti.sup=50:51, quali.sup=52:68, level.ventil=0.05, graph = FALSE) plot.MCA(res, axes=c(1, 2), col.ind="black", col.ind.sup="blue", col.var="darkred", col.quali.sup="darkgreen", label=c("ind", "ind.sup", "quali.sup", "var"), invisible=c("")) plot.MCA(res, axes=c(1, 2), choix="var", col.var="darkred", col.quali.sup="darkgreen", label=c("var", "quali.sup"), invisible=c("")) plot.MCA(res, axes=c(1, 2), choix="quanti.sup", col.quanti.sup="blue", label=c("quanti.sup")) plot.MCA(res,invisible=c("var","quali.sup")) plot.MCA(res,invisible=c("ind","quali.sup")) plot.MCA(res,invisible=c("ind","var")) #Hierarchical clustering res.hcpc<-HCPC(res) res.hcpc #dynGraph dynGraph(res) #EnQuireR res.enmca=ENMCA(Cooking.MCA, quanti.sup=50:51, quali.sup=52:68, level.ventil=0.05, report=TRUE)